home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 July: Mac OS SDK / Dev.CD Jul 96 SDK / Dev.CD Jul 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / Documentation / Development Notes / ODF Examples RoadMap / Views and Graphics < prev    next >
Encoding:
Text File  |  1996-04-26  |  7.7 KB  |  136 lines  |  [TEXT/ttxt]

  1. OpenDoc
  2. Development
  3. Framework
  4.                                                                                                                                                                                      
  5. Views and Graphics
  6. ODF Release 1                                                                                                                                                             
  7.  
  8.  
  9. Table of Contents
  10. -------------------------
  11. • AutoScroll - ODFDraw, ODFContainer
  12. • Controls - ODFForm, ODFButton
  13. • Edit Views - ODFForm
  14. • Layout Management - ODFContainer, ODFDraw, ODFForm
  15. • List Box - ODFForm
  16. • Mapping - ODFClock,
  17. • Modal Dialogs - ODFForm
  18. • Pictures & Bitmaps - ODFBitmap, ODFDraw, ODFForm
  19. • Printing - ODFDraw, ODFForm
  20. • Scaling - ODFDraw, ODFContainer
  21. • Scroller - ODFContainer, ODFDraw, ODFForm
  22. • View Resources - All Samples containing views
  23. • View Tabber - ODFForm 
  24.  
  25.  
  26. AutoScroll
  27.  
  28. ODFDraw: see CShapeTracker::BeginTracking and CShapeTracker::ContinueTracking. A CShapeTracker is used during the creation of a new shape. See also CResizeTracker::BeginTracking and CResizeTracker::ContinueTracking. CResizeTracker is used during the resizing of a shape.
  29.  
  30. ODFContainer: see CResizeTracker::BeginTracking and CResizeTracker::ContinueTracking.  (ODFContainer is a stripped down version of ODFDraw).
  31.  
  32. See the engineering note Scrolling for the autoscroll API.
  33.  
  34.  
  35. Controls
  36.  
  37. ODFForm: this is the showcase example for controls and other views.  The scrolling form contains every type of control: push buttons, radio buttons, check boxes, popup menus and scroll bars.  See views.fr for the control resource definition.  See CFormFrame::CreateSubViews and CFormView::CreateOwnSubViews for creating controls by program.  
  38.  
  39. See CFormFrame::HandleNotification in frame.cpp for the code to respond to the controls' notifications.  In addition to the push buttons that always perform some action we have added examples of popup menu and radio button notifications.
  40.  
  41. ODFButton:  displays a simple push button on which a script or sound file can be dropped, to be run when the button is pressed.
  42.  
  43. Scroll bar controls are also used in ODFDraw and ODFContainer.
  44.  
  45. FW_CControl classes are described in the engineering note Using Controls.
  46.  
  47.  
  48. Edit Views
  49.  
  50. ODFForm: The scrolling form contains several edit views, including a custom class CScrollEdit that supports scrolling and undo/redo commands (see ScrollEd.cpp and EditCmd.cpp). See views.fr for the edit views resource definition.  See CFormView::CreateOwnSubViews for creating edit views by program.  
  51.  
  52. The password dialog contains  two custom edit views, CPwdEditView, used to hide the characters being typed.  See Dialog.cpp.
  53.  
  54. FW_CEditView is described in the engineering note Using Edit Views.
  55.  
  56.  
  57. Layout Management
  58.  
  59. ODFDraw & ODFContainer: both samples are similar in the way the content view is layed out as the frame is resized, see CContainerFrame::AdjustContentViewSize and CDrawView::AdjustToNewLayout.  The other views, the scroll bars, the grow box and the rulers, use the default behavior provided by their bindings resource field (see Views.fr).
  60.  
  61. ODFForm: its content view is centered inside the frame, with a shadow border drawn around it.  See CFormView::AdjustToNewLayout in FormView.cpp
  62.  
  63. See the engineering note Layout Management for more information.
  64.  
  65.  
  66. List Boxes
  67.  
  68. ODFForm: The scrolling form contains a list box with a list of platforms.  It responds to double-clicks in the first item.  You can make multiple selections and add or remove items.  See views.fr for the list view resource definition.  In FormView.cpp see CFormView::CreateOwnSubViews for creating the list box  by program.   See also the CMouseUpBehavior class that allows to detect selections after clicking in the list box.
  69.  
  70. FW_CListBox is described in the engineering note Using List Boxes.
  71.  
  72.  
  73. Mapping
  74.  
  75. ODFClock: mapping is used by ODFClock to display the analog clock scaled to its frame size. The mapping object is created by the constructor of CClockFrame using FW_kCustomConstrained. The mapping is then reset (CClockFrame::ResetMapping) when the first facet is added (CClockFrame::FacetAdded) and every time the frame shape changes. ResetMapping sets the logical extent to 200 by 200, the device extent to the current frame extent and the origin to the middle of the frame.  This makes it possible to draw the clock in logical coordinates with X and Y between -100 and +100.
  76.  
  77.  
  78. Modal Dialogs
  79.  
  80. ODFForm: This samples contains a moveable modal dialog to enter a password.  See views.fr for the dialog resource definition and Dialog.cpp for the source code.
  81.  
  82. All samples use FW_CAboutFrame, a subclass of FW_CDialogFrame, to display their About box.
  83.  
  84. FW_CDialogFrame is described in the engineering note Using  Diaiogs.
  85.  
  86.  
  87. Pictures & Bitmaps
  88.  
  89. ODFBitmap:  uses FW_CPicture on Mac and FW_CBitmap on Windows.   See CBitmapContent::UseDefaultBitmap and CBitmapFrame::Draw.   You can use cut/copy/paste and drag & drop to modify the picture.
  90.  
  91. ODFDraw:  uses the FW_CPicture and FW_CPictureContext to render its shapes into a Macintosh picture during clipboard operations.  See CDrawSelectionPromise::FulfillPromise in DrwPrmse.cpp.  The picture is created only when the promise must be fulfilled, i.e. when somebody else wants to paste the current Draw selection. 
  92.  
  93. ODFForm: should be using FW_CPicture as well for the background picture of its form view.  Instead the current version loads the picture manually in CFormPart::InitPicture and draws it in CFormView::Draw.
  94.  
  95.  
  96. Printing
  97.  
  98. ODFDraw:  lets the user print its content when there is at least 1 shape drawn.  It defines its own print handler in PrintHdl.cpp and adds a progress dialog by linking FWPrint.r to the project.
  99.  
  100. ODFForm: supports content printing by just creating a FW_CPrintHandler object in CFormFrame::NewPrintHandler.
  101.  
  102. The Printing API is described in the engineering note Printing
  103. .
  104.  
  105. Scaling
  106.  
  107. ODFDraw & ODFContainer: both samples let the user change a zoom factor between 50%, 100% and 200% through the Zoom menu command.  See ChangeZoomFactor  called by DoMenu.  Scaling is implemented in the FW_CScroller::ScaleBy method by modifying the frame internal transform.
  108.  
  109.  
  110. Scroller
  111.  
  112. ODFDraw & ODFContainer: both samples use an FW_CScrollBarScroller object and two scroll bar views.  Scrolling of the content view is handled automatically by ODF.  Scroll bars are removed when the frame is embedded , i.e. when it is not the root frame. There is additional code to implement trackers and turn auto scrolling on.
  113.  
  114. ODFForm:  this samples uses a scroller and scroll bar views, too.  However the scroll bars are not removed when the frame is embedded.  Form also contain a subclass of FW_CEditView, CScrollEdit, implementing a scrolling edit view (we can't use FW_CScroller because it is limited to scrolling the content view).
  115.  
  116. FW_CScroller and FW_CScrollBarScroller are described in the engineering note Scrolling.
  117.  
  118.  
  119. View Resources
  120.  
  121. All samples containing views show how to define them in resources in the file Views.fr. The source code of the frame's CreateSubViews method is still there but commented out.
  122.  
  123. ODFForm, ODFDraw & ODFContainer: these samples contain the greatest number of views.  Their Views.fr  contain also a few custom view resource types.
  124.  
  125. See also the engineering notes on each type of views.
  126.  
  127.  
  128. View Tabber
  129.  
  130. ODFForm:  An FW_CViewTabber object is created in CFormFrame::PostCreateViewFromStream to allow tabbing between views that can accept the keyboard focus (i.e. edit views and list boxes).  The view tabber is created automatically in Form's modal dialog by the FW_CDialogFrame class.
  131.  
  132. FW_CViewTabber is described in the engineering note Using Edit Views.
  133.  
  134.  
  135. © 1993 - 1996 Apple Computer, Inc. All rights reserved.
  136. Apple, the Apple Logo, Macintosh, and OpenDoc are trademarks of Apple Computer, Inc., registered in the United States and other countries.